package fr.ssd.sic.imap;

import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;

public class ListMessagesCmd {

	public ListMessagesCmd(){
		
	}
	
	public Message[] execute(Folder folder) throws MessagingException{
		if(!folder.isOpen()){
		  folder.open(Folder.READ_WRITE);
		}
		  return folder.getMessages();
		 
	}
}
